package com.huobao.yunying.adapters;

import com.huobao.yunying.entity.DingdanDetail_good_list;
import com.huobao.yunying.utils.ImageUtils;
import com.huobao.yunying.utils.SkipUtils;
import com.huobao.zhangying.R;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import joanzapata.android.BaseAdapterHelper;
import joanzapata.android.QuickAdapter;

public class Adapter_item extends QuickAdapter<DingdanDetail_good_list> {

	public Adapter_item(Context context) {
		super(context, R.layout.item_dingdan_detail_listview);
	}

	@Override
	protected void convert(BaseAdapterHelper arg0, final DingdanDetail_good_list arg1) {
		ImageView imgView = arg0.getView(R.id.imgView);
		ImageUtils.loadimg(imgView, arg1.goods_image);
		arg0.setText(R.id.tv_goods_name, arg1.goods_name).setText(R.id.tv_price,
				arg1.price + "\n" + "×" + arg1.quantity);
		imgView.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				SkipUtils.seeDetail(context, arg1.goods_id, arg1.goods_image);
			}
		});
	}

}
